home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / util1 / ultmtpch.lha / UPS / Sources / Palette.s < prev    next >
Text File  |  1995-09-30  |  4KB  |  181 lines

  1. ;TOSPJPKPJPKPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPAGAFAGAO
  2.  
  3.     incdir    "include:"
  4.     include    "exec/types.i"
  5.     include    "exec/ports.i"
  6.     include    "libs/exec.i"
  7.     include    "libs/reqtools.i"
  8.     include    "libraries/reqtools.i"
  9.     include    "intuition/intuitionbase.i"
  10.     incdir    "ups:"
  11.     include    "ups.i"
  12.  
  13.  
  14. Start    moveq    #0,d0
  15.     rts
  16. .end    blk.b    32+Start-.end
  17.     dc.l    pfsControlLong
  18.     dc.l    0            ; pointer to next patcher
  19.     dc.l    0            ; pointer to prev patcher
  20.     dc.l    UPSMainVersion        ; minimum version of UPS to start
  21.     dc.l    UPSMainVersion        ; version of UPS which was used
  22.                     ; while patcher was developed
  23.     dc.l    PatcherName        ; pointer to name of patcher
  24.     dc.w    39,0            ; version
  25.     dc.l    CoderName        ; pointer to name of programmer
  26.     dc.l    VerString        ; pointer to $VER: string
  27.     dc.l    PatcherIDString        ; listview entry
  28.     dc.l    pfsDisableable+pfsPrefs    ; flags
  29.     dc.l    0            ; status of flags
  30. execbase
  31.     dc.l    0            ; exec base
  32. intbase    dc.l    0            ; intuition base
  33. gadtbase
  34.     dc.l    0            ; gadtools base
  35. dosbase    dc.l    0            ; dos base
  36. gfxbase    dc.l    0            ; graphics base
  37. cxbase    dc.l    0            ; commodities base
  38. laybase    dc.l    0            ; layers base
  39. upsbase    dc.l    0            ; UPS lib base
  40.     dc.l    0            ; pointer to init routine
  41.     dc.l    0            ; pointer to exit routine
  42.     dc.l    popup            ; pointer to prefs routine
  43.     dc.l    keys            ; pointer to cx keys to call prefs rout
  44.     dc.l    Resources        ; pointer to structure of requested
  45.                         ; opened resources
  46.     dc.l    Patch1            ; pointer to structure for patches
  47.     dc.l    pls1            ; pointer to pls structure
  48.     dc.l    0            ; pointer to main UPS msg port
  49.     dc.l    0            ; pointer to rexx port
  50.     dc.l    0            ; pointer to pxs structure
  51.     dc.l    0,0,0
  52.     dc.l    pfsControlLong
  53.     dc.l    Start            ; pointer to the beginning of struct
  54.  
  55. PatcherName
  56.     dc.b    'Small Palette Utility',0
  57.     even
  58. CoderName
  59.     dc.b    'Goran Mitrovic',0
  60.     even
  61. VerString
  62.     dc.b    '$VER: Small Palette Utility V1.0',0
  63.     even
  64. PatcherIDString
  65.     dc.b    'Small Palette Utility',0            ; 25
  66.     even
  67. keys    dc.b    'rcommand shift p',0
  68.     even
  69.  
  70.  
  71. Resources
  72.     dc.l    0            ; pointer to next entry
  73.     dc.l    0            ; pointer to previous entry
  74.     dc.l    rt_Library        ; type of resource
  75.     dc.l    100            ; resource id
  76.     dc.l    0            ; flags
  77.     dc.l    res1name        ; pointer to name of resource
  78. res1base
  79.     dc.l    0            ; base of opened resource
  80.     dc.l    0            ; version, if needed
  81.     blk.l    8            ; ...to put in data regs
  82.     dc.l    0            ; user open rout for user type
  83.     dc.l    0            ; user close rout for user type
  84.     dc.l    0            ; pointer to name for user type
  85.     dc.l    0,0
  86.  
  87. res1name
  88.     dc.b    'reqtools.library',0
  89.     cnop    0,4
  90.  
  91.  
  92.  
  93. Patch1
  94.     dc.l    0            ; pointer to next patch
  95.     dc.l    0            ; pointer to prev patch
  96.     dc.l    0            ; priority, less runs first
  97.     dc.l    Start            ; pointer to parent Patcher
  98.     dc.l    Patch1ID        ; listview entry
  99.     dc.l    Patch1purpose        ; pointer to purpose string
  100.     dc.l    100            ; id of resource to be patched
  101.     dc.l    mpsDisableable        ; flags
  102.     dc.l    0            ; status of flags
  103.     dc.l    rtPaletteRequestA    ; offset to change
  104.     dc.l    Patch1rout        ; pointer to new routine
  105.     dc.l    0            ; pointer to old routine
  106.     dc.l    0            ; pointer to pns structure
  107.     dc.l    notify            ; notified when enabled/disabled
  108.     dc.l    0            ; install rout for user type
  109.     dc.l    0            ; uninstall rout for user type
  110.     dc.l    0            ; pointer to init routine
  111.     dc.l    0            ; pointer to exit routine
  112.     dc.l    pls1            ; pointer to pls structure
  113.     dc.l    0,0,0,0
  114.  
  115.  
  116. Patch1ID
  117.     dc.b    'rtPaletteRequestA',0        ; 27
  118.     even
  119. Patch1purpose
  120.     dc.b    'nothing',0            ; 16
  121.     cnop    0,4
  122.  
  123.  
  124.  
  125. pls1    dc.l    0            ; pointer to next link
  126.     dc.l    0            ; pointer to prev link
  127.     dc.l    pls1ID            ; listview string
  128.     dc.l    popup            ; pointer to prefs routine
  129.     dc.l    plsDisableable+plsPrefs    ; flags
  130.     dc.l    0            ; status
  131.     dc.l    Patch1
  132.     dc.l    0
  133.  
  134. pls1ID    dc.b    'rtPaletteRequestA',0        ; 27
  135.     cnop    0,4
  136.  
  137.  
  138.  
  139.  
  140. Patch1rout
  141.     rts
  142.  
  143. popup    tst.l    disabled
  144.     bne.s    .exit
  145.     movem.l    d1-a6,-(a7)
  146.     lea    reqname,a1
  147.     move.l    #38,d0
  148.     move.l    4,a6
  149.     jsr    OpenLibrary(a6)
  150.     tst.l    d0
  151.     beq.s    .exit2
  152.     move.l    d0,a6
  153.  
  154.     move.l    intbase,a0
  155.     move.l    ib_ActiveWindow(a0),window
  156.  
  157.     lea    title,a2
  158.     move.l    #0,a3
  159.     lea    tags,a0
  160.     jsr    rtPaletteRequestA(a6)
  161.  
  162.     move.l    a6,a1
  163.     move.l    4,a6
  164.     jsr    CloseLibrary(a6)
  165. .exit2    movem.l    (a7)+,d1-a6
  166. .exit    rts
  167.  
  168. notify    move.l    d0,disabled
  169.     rts
  170.  
  171. disabled
  172.     dc.l    0                ; 1 for disabled
  173.  
  174. title    dc.b    'Palette',0
  175. reqname    dc.b    'reqtools.library',0
  176.     cnop    0,4
  177. tags    dc.l    RT_Window
  178. window    dc.l    0
  179.     dc.l    TAG_DONE,0
  180.  
  181.